package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the staff database table.
 * 
 */
@Entity
@Table(name="staff")
@NamedQuery(name="Staff.findAll", query="SELECT s FROM Staff s")
public class Staff implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String staffid;

	private String address;

	private String img;

	private String phone;

	private byte sex;

	private String sname;

	//bi-directional many-to-one association to Actionhistory
	@OneToMany(mappedBy="staff")
	private List<Actionhistory> actionhistories;

	//bi-directional many-to-one association to Commissiontask
	@OneToMany(mappedBy="staff")
	private List<Commissiontask> commissiontasks;

	//bi-directional many-to-one association to Customer
	@OneToMany(mappedBy="staff")
	private List<Customer> customers;

	//bi-directional many-to-one association to Guanhuaicc
	@OneToMany(mappedBy="staff")
	private List<Guanhuaicc> guanhuaiccs;

	//bi-directional many-to-one association to Order
	@OneToMany(mappedBy="staff")
	private List<Order> orders;

	//bi-directional many-to-one association to Payment
	@OneToMany(mappedBy="staff")
	private List<Payment> payments;

	//bi-directional many-to-one association to Plannedreturn
	@OneToMany(mappedBy="staff")
	private List<Plannedreturn> plannedreturns;

	//bi-directional many-to-one association to Quotationrecord
	@OneToMany(mappedBy="staff")
	private List<Quotationrecord> quotationrecords;

	//bi-directional many-to-one association to Returned
	@OneToMany(mappedBy="staff")
	private List<Returned> returneds;

	//bi-directional many-to-one association to Returnmoney
	@OneToMany(mappedBy="staff")
	private List<Returnmoney> returnmoneys;

	//bi-directional many-to-one association to Roleallocation
	@OneToMany(mappedBy="staff")
	private List<Roleallocation> roleallocations;

	//bi-directional many-to-one association to Salesopportunity
	@OneToMany(mappedBy="staff")
	private List<Salesopportunity> salesopportunities;

	//bi-directional many-to-one association to Send
	@OneToMany(mappedBy="staff")
	private List<Send> sends;

	//bi-directional many-to-one association to Task
	@OneToMany(mappedBy="staff")
	private List<Task> tasks;

	public Staff() {
	}

	public String getStaffid() {
		return this.staffid;
	}

	public void setStaffid(String staffid) {
		this.staffid = staffid;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getImg() {
		return this.img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public byte getSex() {
		return this.sex;
	}

	public void setSex(byte sex) {
		this.sex = sex;
	}

	public String getSname() {
		return this.sname;
	}

	public void setSname(String sname) {
		this.sname = sname;
	}

	public List<Actionhistory> getActionhistories() {
		return this.actionhistories;
	}

	public void setActionhistories(List<Actionhistory> actionhistories) {
		this.actionhistories = actionhistories;
	}

	public Actionhistory addActionhistory(Actionhistory actionhistory) {
		getActionhistories().add(actionhistory);
		actionhistory.setStaff(this);

		return actionhistory;
	}

	public Actionhistory removeActionhistory(Actionhistory actionhistory) {
		getActionhistories().remove(actionhistory);
		actionhistory.setStaff(null);

		return actionhistory;
	}

	public List<Commissiontask> getCommissiontasks() {
		return this.commissiontasks;
	}

	public void setCommissiontasks(List<Commissiontask> commissiontasks) {
		this.commissiontasks = commissiontasks;
	}

	public Commissiontask addCommissiontask(Commissiontask commissiontask) {
		getCommissiontasks().add(commissiontask);
		commissiontask.setStaff(this);

		return commissiontask;
	}

	public Commissiontask removeCommissiontask(Commissiontask commissiontask) {
		getCommissiontasks().remove(commissiontask);
		commissiontask.setStaff(null);

		return commissiontask;
	}

	public List<Customer> getCustomers() {
		return this.customers;
	}

	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}

	public Customer addCustomer(Customer customer) {
		getCustomers().add(customer);
		customer.setStaff(this);

		return customer;
	}

	public Customer removeCustomer(Customer customer) {
		getCustomers().remove(customer);
		customer.setStaff(null);

		return customer;
	}

	public List<Guanhuaicc> getGuanhuaiccs() {
		return this.guanhuaiccs;
	}

	public void setGuanhuaiccs(List<Guanhuaicc> guanhuaiccs) {
		this.guanhuaiccs = guanhuaiccs;
	}

	public Guanhuaicc addGuanhuaicc(Guanhuaicc guanhuaicc) {
		getGuanhuaiccs().add(guanhuaicc);
		guanhuaicc.setStaff(this);

		return guanhuaicc;
	}

	public Guanhuaicc removeGuanhuaicc(Guanhuaicc guanhuaicc) {
		getGuanhuaiccs().remove(guanhuaicc);
		guanhuaicc.setStaff(null);

		return guanhuaicc;
	}

	public List<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public Order addOrder(Order order) {
		getOrders().add(order);
		order.setStaff(this);

		return order;
	}

	public Order removeOrder(Order order) {
		getOrders().remove(order);
		order.setStaff(null);

		return order;
	}

	public List<Payment> getPayments() {
		return this.payments;
	}

	public void setPayments(List<Payment> payments) {
		this.payments = payments;
	}

	public Payment addPayment(Payment payment) {
		getPayments().add(payment);
		payment.setStaff(this);

		return payment;
	}

	public Payment removePayment(Payment payment) {
		getPayments().remove(payment);
		payment.setStaff(null);

		return payment;
	}

	public List<Plannedreturn> getPlannedreturns() {
		return this.plannedreturns;
	}

	public void setPlannedreturns(List<Plannedreturn> plannedreturns) {
		this.plannedreturns = plannedreturns;
	}

	public Plannedreturn addPlannedreturn(Plannedreturn plannedreturn) {
		getPlannedreturns().add(plannedreturn);
		plannedreturn.setStaff(this);

		return plannedreturn;
	}

	public Plannedreturn removePlannedreturn(Plannedreturn plannedreturn) {
		getPlannedreturns().remove(plannedreturn);
		plannedreturn.setStaff(null);

		return plannedreturn;
	}

	public List<Quotationrecord> getQuotationrecords() {
		return this.quotationrecords;
	}

	public void setQuotationrecords(List<Quotationrecord> quotationrecords) {
		this.quotationrecords = quotationrecords;
	}

	public Quotationrecord addQuotationrecord(Quotationrecord quotationrecord) {
		getQuotationrecords().add(quotationrecord);
		quotationrecord.setStaff(this);

		return quotationrecord;
	}

	public Quotationrecord removeQuotationrecord(Quotationrecord quotationrecord) {
		getQuotationrecords().remove(quotationrecord);
		quotationrecord.setStaff(null);

		return quotationrecord;
	}

	public List<Returned> getReturneds() {
		return this.returneds;
	}

	public void setReturneds(List<Returned> returneds) {
		this.returneds = returneds;
	}

	public Returned addReturned(Returned returned) {
		getReturneds().add(returned);
		returned.setStaff(this);

		return returned;
	}

	public Returned removeReturned(Returned returned) {
		getReturneds().remove(returned);
		returned.setStaff(null);

		return returned;
	}

	public List<Returnmoney> getReturnmoneys() {
		return this.returnmoneys;
	}

	public void setReturnmoneys(List<Returnmoney> returnmoneys) {
		this.returnmoneys = returnmoneys;
	}

	public Returnmoney addReturnmoney(Returnmoney returnmoney) {
		getReturnmoneys().add(returnmoney);
		returnmoney.setStaff(this);

		return returnmoney;
	}

	public Returnmoney removeReturnmoney(Returnmoney returnmoney) {
		getReturnmoneys().remove(returnmoney);
		returnmoney.setStaff(null);

		return returnmoney;
	}

	public List<Roleallocation> getRoleallocations() {
		return this.roleallocations;
	}

	public void setRoleallocations(List<Roleallocation> roleallocations) {
		this.roleallocations = roleallocations;
	}

	public Roleallocation addRoleallocation(Roleallocation roleallocation) {
		getRoleallocations().add(roleallocation);
		roleallocation.setStaff(this);

		return roleallocation;
	}

	public Roleallocation removeRoleallocation(Roleallocation roleallocation) {
		getRoleallocations().remove(roleallocation);
		roleallocation.setStaff(null);

		return roleallocation;
	}

	public List<Salesopportunity> getSalesopportunities() {
		return this.salesopportunities;
	}

	public void setSalesopportunities(List<Salesopportunity> salesopportunities) {
		this.salesopportunities = salesopportunities;
	}

	public Salesopportunity addSalesopportunity(Salesopportunity salesopportunity) {
		getSalesopportunities().add(salesopportunity);
		salesopportunity.setStaff(this);

		return salesopportunity;
	}

	public Salesopportunity removeSalesopportunity(Salesopportunity salesopportunity) {
		getSalesopportunities().remove(salesopportunity);
		salesopportunity.setStaff(null);

		return salesopportunity;
	}

	public List<Send> getSends() {
		return this.sends;
	}

	public void setSends(List<Send> sends) {
		this.sends = sends;
	}

	public Send addSend(Send send) {
		getSends().add(send);
		send.setStaff(this);

		return send;
	}

	public Send removeSend(Send send) {
		getSends().remove(send);
		send.setStaff(null);

		return send;
	}

	public List<Task> getTasks() {
		return this.tasks;
	}

	public void setTasks(List<Task> tasks) {
		this.tasks = tasks;
	}

	public Task addTask(Task task) {
		getTasks().add(task);
		task.setStaff(this);

		return task;
	}

	public Task removeTask(Task task) {
		getTasks().remove(task);
		task.setStaff(null);

		return task;
	}

}